package com.fymxy.question_bank_management.mapper;

import com.fymxy.question_bank_management.pojo.Request2teacher;

import java.util.List;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import org.apache.ibatis.annotations.*;
import org.springframework.stereotype.Component;


@Mapper
@Component
public interface Request2teacherMapper {

    @Delete("delete from request2teacher where request_signup_no = #{requestSignupNo}")
    int deleteByPrimaryKey(Integer requestSignupNo);

    @Insert("insert into request2teacher (teacher_nickname,teacher_name,teacher_pwd,teacher_discipline,teacher_mail,request_date) values " +
            "(#{teacherNickname},#{teacherName},#{teacherPwd},#{teacherDiscipline},#{teacherMail},#{requestDate})")
    int insert(Request2teacher record);

    @Select("select * from request2teacher")
    @Results(id = "Request2teacherMap",value = {
            @Result(column = "request_signup_no",property = "requestSignupNo"),
            @Result(column = "teacher_nickname",property = "teacherNickname" ),
            @Result(column = "teacher_name",property = "teacherName"),
            @Result(column = "teacher_pwd",property = "teacherPwd"),
            @Result(column = "teacher_discipline",property = "teacherDiscipline"),
            @Result(column = "teacher_mail",property = "teacherMail"),
            @Result(column = "request_date",property = "requestDate")
    })
    IPage<Request2teacher>findAll(Page page);

    int insertSelective(Request2teacher record);


    Request2teacher selectByPrimaryKey(Integer requestSignupNo);


    int updateByPrimaryKeySelective(Request2teacher record);

    int updateByPrimaryKey(Request2teacher record);
}